Microorganisms play key roles in biogeochemical and nutrient cycling in all ecosystems on Earth, yet little is known about the processes controlling their biogeographic distributions. Here we report an investigation of magnetotactic bacteria (MTB) designed to evaluate the roles of niche-based process and spatial process in explaining variation in bacterial communities across large spatial scales. Our results show that both environmental heterogeneity and geographic distance play significant roles in shaping dominant populations of MTB community composition. At the spatial scale in this study, the biogeography of MTB is relatively more influenced by environmental factors than geographic distance, suggesting that local conditions override the effects of dispersal history on structuring MTB community. Of note, we found that the strength of geomagnetic field may influence the biogeography of MTB. We argue that MTB have the potential to serve as a model group to uncover the underlying processes that influence microbial biogeography.